package top.btcmarket.auth.mapper;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import top.btcmarket.auth.entity.RoleResources;
import top.btcmarket.auth.entity.UserRole;


@Repository
public interface RoleResourcesRepository extends JpaRepository<RoleResources,Long> {

    List<RoleResources> findByuid(int uid);

   /* @Query(value = "select r.role_name from user_role ur left join role r on ur.rid=r.id where ur.uid = ?1",nativeQuery = true)
    List<String> findRoleName(int uid);
    
    
    @Query(value = "select r.role_name from user_role ur left join role r on ur.rid=r.id where ur.uid = ?1",nativeQuery = true)
    List<RoleResources> findResourceByUserId(int uid);*/
    
}
